1. Field of the Invention
The present invention relates to an image processing method, an image processing device and a bonding apparatus that includes such an image processing device; and more particularly the present invention relates to a method and device that detects the position of an object of detection by way of performing pattern matching of the object of detection and a reference image.
2. Prior Art
In image processing techniques, a pattern matching is widely used. The pattern matching generally uses a portion of a reference image (constituting a known image) as a template image in order to detect the position of an object of detection by detecting the position of this known image contained in the image of the object of detection.
A position detection method that uses such pattern matching will be described below with reference to a wire bonding apparatus, which is a semiconductor assembly apparatus, as an example.
In a wire bonding apparatus, wires, typically metal wires, are bonded so that bonding pads consisting of, for instance, aluminum on the surfaces of semiconductor chips are connected to leads consisting of conductors that are formed so that the leads surround the semiconductor chips. Prior to this bonding operation, the bonding points, which are the points where bonding is performed, are calculated using pattern matching.
In pattern matching, as shown in FIG. 8, respective alignment points 32a which are reference points used for positioning are first registered. In a wire bonding apparatus of the type shown in FIG. 1 in which a camera that is fastened to an XY table via a bonding head and a camera arm is moved in the horizontal direction relative to a semiconductor chip by the operation of the XY table, such alignment points are registered in the following manner: the visual field is moved by moving the XY table 1 to which the camera 7 is fastened via the bonding head 2 and camera arm 6 while an image from the camera 7 that has imaged the semiconductor chip 14a is displayed on the display screen of a monitor 39; and the center point 32a of the cross mark 32 that indicate the center of the visual field displayed on the display screen of the monitor 39 is aligned with an arbitrary point on the semiconductor chip 14a; and then an input operation involving the pressing of the input switch of a manual input means 33, etc., is performed; and finally, a region that is surrounded by rectangular reticle mark 42 and is centered on the center point 32a is stored in a data memory 36 as a template image, and the coordinates on the XY table 1 in this case are also stored in the data memory 36 as alignment points.
Generally, in order to minimize detection error, two places are selected for the pad side (Pa1x, Pa1y), (Pa2x, Pa2y), and two places are selected for the lead side (La1x, La1y), (La2x, La2y), as the alignment points from a diagonal line in the vicinity of the corners of the semiconductor chip 14a. 
Next, when the center point 32a of the cross mark 32 is aligned with appropriate positions on the individual pads P and leads L, typically with points that are located substantially in the centers of the respective pads P and leads L; and then the input switch is pressed. Thus, the coordinates of the respective bonding points are stored in the data memory 36.
In run time processing (i.e., processing during actual production of the object product), a new semiconductor device 14 that is the object of detection is set, and the XY table 1 is moved by the control of an operating device (not shown) so that the area in the vicinity of each registered alignment point A0 becomes the visual field of the camera 7 (FIG. 9). An image of the new semiconductor device 14 is acquired by the camera 7. Then, using the registered reference image, by way of pattern matching detection, when the amount of coincidence between the image of the object of detection and the reference image shows a maximum value and when such an amount of coincidence is over the specified threshold value, it is judged that a satisfactory detection is obtained; and the reference image is superimposed on the image of the object of detection at their relative positions, and the amount of positional deviation (ΔX, ΔY) between the position coordinates of the center point 32a in this attitude on the XY table 1 and the position coordinates of the alignment point A0 (which is the position of the center point 32a at the time of the previous registration of the template image) on the XY table 1, e.g., (Pa1x, Pa1y), is determined. The positional deviation is determined likewise for the remaining alignment points 32a, the calculated amounts of positional deviation (ΔX, ΔY) are added to the position coordinates of the alignment points measured at the time of the previous registration of the template image, e.g., as (Pa1x+ΔX, Pa1y+ΔY), and the values thus obtained are designated as new alignment points Am. “Am” is a symbol, and “m” referred to here is not a numerical value that has a range.
Next, the positions of the respective pads and leads are determined by calculation from the positions of the new alignment points Am in a form that preserves the relative positions of the respective pads and leads at the time of registration with respect to the alignment points A0 (hereafter, this is referred to as “position correction”), thus determining the actual bonding points. Then, bonding operations are performed on these actual bonding points.
In cases where the semiconductor device 14 that is the object of detection is disposed in an attitude that includes a positional deviation in the direction of rotation, the portions of the image of the object of detection that do not coincide with the reference image increases. As a result, there is an increase in the number of cases in which the maximum amount of coincidence in the pattern matching detection using the reference image does not exceed the threshold value, so that detection is judged to be impossible. Ordinarily, therefore, a positional deviation of ±5° in the direction of rotation of the object of detection is considered to be the limit.
In order to expand such a maximum allowable range of the positional deviation of the object of detection in the direction of rotation, various methods have been proposed. For instance, in Japanese Patent Application Laid-Open (Kokai) No. 9-102039, a plurality of different types of rotated images obtained by rotating the reference image by various angles are prepared in advance as template images, and pattern matching is performed between these template images and an image of the object of detection. However, in such prior art methods, pattern matching at increments of several degrees in the direction of rotation must be performed for numerous points within the visual field. Thus, the quantity of calculations required is significant large, and the recognition speed is slow. Thus, such methods are impractical.
Furthermore, positional deviation of the object of detection in the direction of rotation can also cause a drop in the precision of detection. The inherent reason for this is as follows: if the image of the object of detection and the reference image are superimposed so that the amount of coincidence shows a maximum value for the pattern that serves as a reference (pad P in FIG. 9), then the position of a new alignment point Am stipulated by the position relative to the pattern that serves as a reference should coincide with the position of the original alignment point A0 similarly stipulated by the position relative to the pad P in the reference image; however, as shown in FIG. 10, in cases where the semiconductor device 14 that constitutes the object of detection is disposed in an attitude that includes a positional deviation in the direction of rotation, even if the image of the object of detection and the reference image are superimposed so that the amount of coincidence shows a maximum value with respect to the pattern that serves as a reference (the pad P in FIG. 10), the original alignment point A0 and the new alignment point Am do not coincide.
The error caused by this positional deviation of the object of detection in the direction of rotation is not a problem if the pitch between the pads P or leads L is sufficiently large. However, such error becomes a major problem when it is necessary to handle the increasingly fine pitches seen in recent years, i.e., the increasingly fine pitches between pads P or between leads L.
There are also methods in which numerous small template images in which the image region is reduced are prepared in addition to template images of the ordinary size, rough positions are assigned using these template images of the ordinary size, and then accurate positions are subsequently detected using the small template images. In such methods, however, pattern matching is performed using numerous small template images. Thus, the recognition speed is slow.
Meanwhile, various methods have also been proposed in which a mask pattern is used to mask unnecessary portions in the image of the object of detection (especially portions which are such that the precision of detection is caused to drop when the object of detection is rotated) during pattern matching (see, for instance, Japanese Patent Application Laid-Open (Kokai) Nos. 7-21377 and 2-148180). However, the preparation of this mask pattern is performed by hand, and thus there is a demand for some means that make this process work more efficiently. In this regard, there is a method that automatically produces a mask pattern with a fixed width so that the edge portions of the pattern that serves as a reference in the image of the object of detection are covered. However, this method has drawbacks. The detection precision decreases when no positional deviation is involved in the direction of rotation.